<template>
    <div class="edit-popup">
        <popup ref="popupRef" title="审批日志" :async="true" width="550px" @confirm="handleSubmit"
            @close="handleClose">

            <div style="max-width: 600px">
            <el-steps direction="vertical" :active="0">
            <el-step v-for="(item,index) in LogSteps " :key="index" :title="item.title" :description="item.description"  :status="item.status"/>
            </el-steps>
        </div>
        </popup>
    </div>
</template>
<script lang="ts" setup>
import type { FormInstance } from 'element-plus'
import { flowEdit, flowAdd, flowLogDetail, flowAll, flowSearchUser } from '@/api/org/flow'
import Popup from '@/components/popup/index.vue'
import { useDictOptions } from '@/hooks/useDictOptions'
import request from '@/utils/request'

const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')




const LogSteps = ref([])

// 远程姓名检索


const handleSubmit = async () => {
    //await formRef.value?.validate()
    //popupRef.value?.close()
     emit('close')
}

const open = (type = 'add') => {
    mode.value = type
    popupRef.value?.open()
}



const getDetail = async (fid:number ,row: Record<string, any>) => {
     LogSteps.value = await flowLogDetail({
        fid: fid,
        appid: row.id
     }) 
    console.log('得到数据=', LogSteps);

}

const handleClose = () => {
    emit('close')
}

defineExpose({
    open,
    getDetail
})
</script>
